<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>jquery的ajax请求</h1>
    <button id="btn">发起请求</button>
</body>

</html>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>


    btn.onclick = function () {

        // $.get(请求地址,callback)

        // $.get("http://localhost:3000/students",(results)=>{
        //     // 请求成功之后的回调函数
        //     console.log(results);
        // })

        $.get("http://localhost:3000/students?username=zs",(results)=>{
            // 请求成功之后的回调函数
            console.log(results);
        })



    }



</script>